package hu.bme.mit.mdsd.service.generator

import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.generator.IGenerator
import system.*

class dotNetServiceModelGenerator implements IGenerator {
	override void doGenerate(Resource input, IFileSystemAccess fsa) {
		for(p:input.allContents.toIterable.filter(typeof(System) )){
  			if (p.targetPlatform == Platform::DOT_NET){
		        for(e: p.eAllContents.toIterable.filter(typeof(RestService))) {
		            fsa.generateFile(e.name + ".java", e.compile)
		
		        }
		    }
		}
    }

	def compile(RestService e)'''
	Hey Sexy PHP! :D
	
	'''
}